<?php
namespace app\service;
use think\facade\Db;
class RecordService{
    public function getRecordList($community_id,$page,$where){
        return Db::name('records')
            ->where('community_id','in',$community_id)
            ->where($where)
            ->order('id desc')
            ->paginate(50, false, [
                'page'  =>  $page,
                'query' =>  $where
            ]);

    }

    public function recordCount($community_id,$where)
    {
        return Db::name('records')
            //->where('community_id','in',$community_id)
            ->where($where)->count();
    }
    public function getStrangerList($community_id,$page,$where){
        return Db::name('records_stranger')
            ->where('community_id','in',$community_id)
            ->where($where)
            ->order('id desc')
            ->paginate(50, false, [
            'page'  =>  $page,
            'query' =>  $where
        ]);

    }
    public function strangerCount($community_id,$where){
        return Db::name('records_stranger')
            //->where('community_id','in',$community_id)
            ->where($where)->count();
    }

}